home *** CD-ROM | disk | FTP | other *** search
- global gNullCastNum, gLHiliteList, gRHiliteList, gLeftGoToList, gRightGoToList, gPictInAStringL, gPictInAStringR, gLastRollover, gLastPiePiece
-
- on localInit
- setGlobals()
- preloadSoundMovies()
- end
-
- on preloadSoundMovies
- global gLeftGoToList, gRightGoToList, gBaseURL
- repeat with i = 1 to integer((count(gLeftGoToList) + count(gRightGoToList)) / 2) - 2
- addToLoadQueue(getAt(gLeftGoToList, i) & ".dcr")
- addToLoadQueue(getAt(gRightGoToList, i) & ".dcr")
- end repeat
- end
-
- on setGlobals
- if not gPictInAStringL then
- set gPictInAStringL to the text of cast "Left Mask Text"
- end if
- if not gPictInAStringR then
- set gPictInAStringR to the text of cast "Right Mask Text"
- end if
- if not gLHiliteList then
- set gLHiliteList to []
- repeat with x = 1 to 18
- add(gLHiliteList, the number of member ("Left Hilite" && string(x)))
- end repeat
- add(gLHiliteList, the number of member "Null Hilite")
- end if
- if not gRHiliteList then
- set gRHiliteList to []
- repeat with x = 1 to 18
- add(gRHiliteList, the number of member ("Right Hilite" && string(x)))
- end repeat
- add(gRHiliteList, the number of member "Null Hilite")
- end if
- set gNullCastNum to the number of member "Null Hilite"
- if not gLeftGoToList then
- set gLeftGoToList to ["Phones", "Sci-Fi", "Human", "Swishes", "Industrial", "Vehicles", "Water", "Weather", "Whooshes", "Textures", "Household", "Squeaks", "Impacts", "Switches", "Liquids", "Media", "Monsters", "Office", "RightChoice"]
- end if
- if not gRightGoToList then
- set gRightGoToList to ["Creaks", "Comedy", "Crowds", "Computers", "Doors", "Electrics", "Animals", "Fire", "Explosions", "Bells", "Alarms", "Ambience", "Beeps", "Arcade", "Guns", "Camera", "Buttons", "Gore", "LeftChoice"]
- end if
- if not gLastPiePiece then
- set gLastPiePiece to 0
- end if
- end
-
- on GrayMatterPrint
- beep()
- end
-
- on initText
- set gLastRollover to 48
- repeat with channel = 10 to 14
- puppetSprite(channel, 1)
- end repeat
- end
-
- on PupsOff
- puppetSound(0)
- repeat with channel = 10 to 21
- puppetSprite(channel, 0)
- end repeat
- updateStage()
- end
-
- on stopMovie
- PupsOff()
- end
-
- on checkRoll
- repeat with spriteCounter = 10 to 14
- set gLastRollover to 48
- if rollOver(spriteCounter) and (spriteCounter <> gLastRollover) then
- set gLastRollover to spriteCounter
- puppetSound(0)
- if not soundBusy(1) then
- set theSound to "word" & spriteCounter
- puppetSound(theSound)
- end if
- set the castNum of sprite spriteCounter to the number of member (spriteCounter & "hi")
- updateStage()
- repeat while rollOver(spriteCounter) and the mouseUp
- end repeat
- set the castNum of sprite spriteCounter to the number of member (gLastRollover & "or")
- updateStage()
- end if
- end repeat
- end
-
- on LeftSide
- set whichOne to FindColorOfPixelUnderCursorL()
- if whichOne <> gLastPiePiece then
- if whichOne = 0 then
- set the castNum of sprite 2 to gNullCastNum
- else
- if whichOne = 19 then
- set the castNum of sprite 2 to gNullCastNum
- updateStage()
- go(getAt(gLeftGoToList, whichOne))
- else
- puppetSound("click1.aif")
- set the castNum of sprite 2 to getAt(gLHiliteList, whichOne)
- set gLastPiePiece to whichOne
- updateStage()
- end if
- end if
- end if
- end
-
- on RightSide
- set whichOne to FindColorOfPixelUnderCursorR()
- if whichOne <> gLastPiePiece then
- if whichOne = 0 then
- set the castNum of sprite 2 to gNullCastNum
- else
- if whichOne = 19 then
- set the castNum of sprite 2 to gNullCastNum
- updateStage()
- go(getAt(gRightGoToList, whichOne))
- else
- puppetSound("click1.aif")
- set the castNum of sprite 2 to getAt(gRHiliteList, whichOne)
- set gLastPiePiece to whichOne
- updateStage()
- end if
- end if
- end if
- end
-
- on LaunchLeftChoice
- set whichOne to FindColorOfPixelUnderCursorL()
- if whichOne = 0 then
- exit
- else
- goMovie(getAt(gLeftGoToList, whichOne) & ".dcr")
- end if
- end
-
- on LaunchRightChoice
- set whichOne to FindColorOfPixelUnderCursorR()
- if whichOne = 0 then
- exit
- else
- goMovie(getAt(gRightGoToList, whichOne) & ".dcr")
- end if
- end
-
- on initRollOvers
- if the puppet of sprite 2 = 0 then
- puppetSprite(2, 1)
- end if
- set the visible of sprite 2 to 1
- end
-
- on LoadRawPictIntoString
- if objectp(myObj) then
- myObj(mdispose)
- end if
- end
-
- on FindColorOfPixelUnderCursorL
- set x to the mouseH / 2
- set y to the mouseV / 2
- set locOfPixelInString to (y * 160) + x + 1
- return charToNum(char locOfPixelInString of gPictInAStringL)
- end
-
- on FindColorOfPixelUnderCursorR
- set x to the mouseH / 2
- set y to the mouseV / 2
- set locOfPixelInString to (y * 160) + x + 1
- return charToNum(char locOfPixelInString of gPictInAStringR)
- end
-